package com.cw.controller;


import com.cw.common.api.Response;
import com.cw.common.api.ResultObject;
import com.cw.dto.RjszDTO;
import com.cw.service.IPatientBedMiddleRjszService;
import com.cw.vo.ThisIiPrepayinRJVO;
import com.cw.vo.rjszVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * @author smq
 * @since 2021-05-09
 */
@Api(tags = {"日间输注/手术中间表"})
@RestController
@RequestMapping("/patient-bed-middle-rjsz")
public class PatientBedMiddleRjszController {

    @Autowired
    private IPatientBedMiddleRjszService targetService;

    @ApiOperation(value = "根据preid查询日间患者信息")
    @GetMapping("/getIiPrepayinByIdRJ")
    public ResultObject getIiPrepayinByIdRJ(BigDecimal preid) {
        return ResultObject.successReturn(targetService.getIiPrepayinByIdRJ(preid));
    }

    @ApiOperation(value = "查询可预约日间输注")
    @GetMapping("/searchRJSZ")
    public ResultObject searchRJSZ() {
        return ResultObject.successReturn(targetService.searchRJSZ());
    }

    @ApiOperation(value = "查询可预约日间手术")
    @GetMapping("/searchRJSS")
    public ResultObject searchRJSS() {
        return ResultObject.successReturn(targetService.searchRJSS());
    }


    @ApiOperation(value = "预约")
    @PostMapping("/addPatientBed")
    public Response addPatientBed(@RequestBody RjszDTO entity) {
        return targetService.addPatientBed(entity);
    }


    @ApiOperation(value = "取消预约")
    @GetMapping("/delPatientBed")
    public Response delPatientBed(String id) {
        return targetService.delPatientBed(id);
    }
    @ApiOperation(value = "完成输注")
    @GetMapping("/updatePatientBed")
    public Response updatePatientBed(String id){
        return targetService.updatePatientBed(id);
    }
}

